package com.fa4j.third.user.config;

import com.fa4j.third.base.config.ThirdAdapterConfigurer;
import com.fa4j.third.base.proxy.ThirdProxyFactoryBean;
import com.fa4j.third.base.service.ThirdConfigService;
import com.fa4j.third.user.service.ThirdUserOauth2Service;
import jakarta.validation.Validator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

import java.util.List;

@AutoConfiguration
public class ThirdUserAutoConfiguration {

    @Bean
    public ThirdProxyFactoryBean<ThirdUserOauth2Service> thirdUserOauth2Service(ThirdConfigService thirdConfigService,
                                                                                List<ThirdAdapterConfigurer> configurers,
                                                                                Validator validator) {
        return new ThirdProxyFactoryBean<>(ThirdUserOauth2Service.class, thirdConfigService, configurers, validator);
    }

}
